package db.dao;

import db.dto.*;
import db.exceptions.*;

public interface PatientDao
{
	/** 
	 * Inserts a new row in the PATIENT table.
	 */
	public int insert(PatientDto dto) throws PatientDaoException;

	/** 
	 * Updates a single row in the PATIENT table.
	 */
	public void update(int pk, PatientDto dto) throws PatientDaoException;

	/** 
	 * Deletes a single row in the PATIENT table.
	 */
	public void delete(int pk) throws PatientDaoException;

	/** 
	 * Returns the rows from the PATIENT table that matches the specified primary-key value.
	 */
	public PatientDto findByPrimaryKey(int idPatient) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria ''.
	 */
	public PatientDto[] findAll() throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria 'ID_DOCTOR = :idDoctor'.
	 */
	public PatientDto[] findByDoctor(int idDoctor) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria 'ID_NURSE = :idDoctor'.
	 */
	public PatientDto[] findByNurse(int idNurse) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria 'ID_PATIENT = :idPatient'.
	 */
	public PatientDto[] findByPerson(int idPatient) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria 'ID_PRESCRIPTION = :idPrescription'.
	 */
	public PatientDto[] findByPrescription(int idPrescription) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria 'ID_PATIENT = :idPatient'.
	 */
	public PatientDto[] findWhereIdPatientEquals(int idPatient) throws PatientDaoException;
	/**
	 * Returns all rows from the PATIENT table that match the criteria 'ID_NURSE = :idDoctor'.
	 */
	public PatientDto[] findWhereIdNurseEquals(int idNurse) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria 'ID_DOCTOR = :idDoctor'.
	 */
	public PatientDto[] findWhereIdDoctorEquals(int idDoctor) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the criteria 'ILLNESSHISTORY = :illnesshistory'.
	 */
	public PatientDto[] findWhereIllnesshistoryEquals(String illnesshistory) throws PatientDaoException;

	/** 
	 * Sets the value of maxRows
	 */
	public void setMaxRows(int maxRows);

	/** 
	 * Gets the value of maxRows
	 */
	public int getMaxRows();

	/** 
	 * Returns all rows from the PATIENT table that match the specified arbitrary SQL statement
	 */
	public PatientDto[] findByDynamicSelect(String sql, Object[] sqlParams) throws PatientDaoException;

	/** 
	 * Returns all rows from the PATIENT table that match the specified arbitrary SQL statement
	 */
	public PatientDto[] findByDynamicWhere(String sql, Object[] sqlParams) throws PatientDaoException;

}
